package demo;
import java.util.Comparator;
import java.util.PriorityQueue;

/**
 * @Author 12629
 * @Description：
 */
//无返回值无参数
@FunctionalInterface
interface NoParameterNoReturn {
    void test();
}
//无返回值一个参数
@FunctionalInterface
interface OneParameterNoReturn {
    void test(int a);
}

//无返回值多个参数
@FunctionalInterface
interface MoreParameterNoReturn {
    void test(int a,int b);
}

//有返回值无参数
@FunctionalInterface
interface NoParameterReturn {
    int test();
}


//有返回值一个参数
@FunctionalInterface
interface OneParameterReturn {
    int test(int a);
}

//有返回值多参数
@FunctionalInterface
interface MoreParameterReturn {
    int test(int a,int b);
}

public class Lambdademo {

    public static void main(String[] args) {
        int a = 99;
        MoreParameterReturn moreParameterReturn = (x,y)->{
            //a = 9999;
            System.out.println(a);
            return x+y;
        };
        System.out.println(moreParameterReturn.test(10, 20));


        /*OneParameterReturn oneParameterReturn = a -> a;
        System.out.println(oneParameterReturn.test(10));*/
/*
        NoParameterReturn noParameterReturn = ()->{return 10;};
*/
       /* NoParameterReturn noParameterReturn = ()-> 10;
        System.out.println(noParameterReturn.test());*/

    }
}
